#include <iostream>
#include <string.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h> //in_addr, in6_addr

using namespace std;

struct in6_addr v6_addr;
struct in_addr v4_addr;

int main (void)
{
	string ipv6_str;
	char buff[16];
	cin >> ipv6_str;
	inet_pton(AF_INET6, ipv6_str.c_str(), (void *)&v6_addr);
		
	memset(buff, 0, 16);
	if (0 == inet_ntop(AF_INET6, (void *)&v6_addr, buff, 16))
	{
		perror("6 failed :");
	}
	printf("inet_ntop6: %s\n", buff);

	int addr4 = 0xff00ff00;
	memcpy(&v4_addr, &addr4, 4);
	if (0 == inet_ntop(AF_INET, (void *)&v4_addr, buff, 16))
	{
		perror("4 failed :");
	}
	printf("inet_ntop4: %s\n", buff);
	char str_int[10];
	sprintf(str_int, "%d", 123456);
	ipv6_str = str_int;
	cout << ipv6_str << endl;
	sprintf(str_int, "%d", 123);
	ipv6_str = str_int;
	cout << ipv6_str << endl;
	sprintf(str_int, "%d", 12345);
	ipv6_str = str_int;
	cout << ipv6_str << endl;
	return 0;
}
